<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRafflesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('raffles', function (Blueprint $table) {
            $table->id();
            $table->string('name',200)->comment('抽到的奖品名称');
            $table->integer('userId')->comment('用户id');
            $table->integer('num')->comment('数量');
            $table->tinyInteger('status')->default('1')->comment('奖品状态 1：可兑换 0：过期');
            $table->timestamps();
            //软删
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('raffles');
    }
}
